package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/schema"
	"entgo.io/ent/schema/field"

	cent "gitee.com/shuokeyun/common/ent"
)

type Merchant struct {
	ent.Schema
}

func (Merchant) Mixin() []ent.Mixin {
	return []ent.Mixin{
		cent.OrmMixin{},
	}
}

func (Merchant) Annotations() []schema.Annotation {
	return []schema.Annotation{
		entsql.Annotation{
			Table: "sk_merchant",
		},
	}
}

func (Merchant) Fields() []ent.Field {
	return []ent.Field{
		field.String("name").Comment("商户名"),
		field.Int32("price_area").Immutable().Comment("物价区域"),
		field.Int32("salesman_id").Comment("业务员id"),
		field.Int8("discount").Comment("折扣 0-100"),
		field.Int8("contract_discount").Comment("签约折扣 0-100"),
		field.Int8("settle_type").Comment("结算方式 1订单;2日结;3月结"),
		field.String("introduction").Comment("简介"),
		field.String("province_code").Comment("省"),
		field.String("city_code").Comment("市"),
		field.String("area_code").Comment("区"),
		field.String("address").Comment("详细地址"),
		field.String("lng").Comment("经度"),
		field.String("lat").Comment("纬度"),
		field.Int8("status").Comment("状态 -1未审核;1正常;2禁用"),
		field.Int8("institutional_type").Comment("类型 1诊所;2门诊;3卫生室;4卫生院;5服务中心;6服务站;7医院;10其他"),
		field.String("main_business").Comment("主营业务 逗号分隔 1综合;2西医;3中医;4妇科;5儿科;6其他"),
	}
}
